﻿using System;
using System.Collections.Generic;
using System.Net.WebSockets;
using System.Threading.Tasks;
using ZilLion.Service.Core.ConfigManager.Manager;
using ZilLion.Service.Core.WebSocket;
using ZilLion.Service.Core.WebSocket.Interface;

namespace ZilLion.Service.TaskPlatform.Controllers.Websocket
{
    public class TaskPlatformWebSocketHandler: WebSocketHandler
    {
        public TaskPlatformWebSocketHandler(WebSocketConnectionManager webSocketConnectionManager, IMessagePersistenceHandle persistenceHandle) : base(webSocketConnectionManager, persistenceHandle)
        {
        }

        public override async Task OnConnected(WebSocket socket, string clientid)
        {

            await base.OnConnected(socket, clientid);
            var id= WebSocketConnectionManager.GetId(socket);
            WebSocketConnectionManager.AddToGroup(id, clientid);
               
        }
    }
}